<?php
namespace Erp\Controller;
use Think\Controller;
use Erp\C\Orders;
use Erp\C\Xpublic;
use Erp\Model;
use Fn;
use Erp\C\Orders\Tn;
class OrdersShippingExtendController extends Controller{
    //修改扩展
	public function saveExtendValue($ordersId,$extendValue){
        $param = array();
        $param['table'] = 'orders_shipping_extend';
        $param['where'] = array('orders_id' => $ordersId);
        $param['method'] ='save';
        $param['data'] = array('extend_value' => $extendValue);
        $json = json_encode($param);
        $url = 'http://192.168.0.235/erp2/index.php?s=Erp-CrontabManage-operateMysql&param='.$json;
        file_get_contents($url);
	}

    /**
     * @param $ordersId
     * @param $extendValue
     * 添加扩展表数据
     */
    public function addExtendValue($ordersId,$extendValue){
        $param = array();
        $param['table'] = 'orders_shipping_extend';
        $param['where'] = '';
        $param['method'] ='add';
        $param['data'] = array(
            'orders_id' => $ordersId,
            'extend_value' => $extendValue
        );
        $json = json_encode($param);
        $url = 'http://192.168.0.235/erp2/index.php?s=Erp-CrontabManage-operateMysql&param='.$json;
        file_get_contents($url);
    }
	public function getExtendValue($ordersId) {
        $param = array();
        $param['table'] = 'orders_shipping_extend';
        $param['where'] = array('orders_id'=>$ordersId);
        $param['method'] = 'find';
        $param['data'] = '';
        $json = json_encode($param);
        $url = 'http://192.168.0.235/erp2/index.php?s=Erp-CrontabManage-operateMysql&param='.$json;
        $res = file_get_contents($url);
        $res = json_decode($res,true);
        return $res;
	}
}